import Vue from 'vue'
import App from './App'
import validate from 'ys-validate.js'
// main.js
import wx from 'weixin-js-sdk'
Vue.prototype.$wx = wx


Vue.config.productionTip = false
// 挂载到全局
Vue.prototype.$validate = validate

// 请求响应拦截
let originRequest = uni.request
uni.request = function() {
	if(arguments[0]) {
		let originUscc = arguments[0].success
		 arguments[0].success = function (res) {
			 if(res.data.code===500) {
				 uni.showModal({
					 title: '提示',
				 	content: res.data.message,
					showCancel: false
					
				 })
			 }
			 originUscc(res)
		 }
	}
	return originRequest.apply(uni, arguments)
}

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
